//package com.wxzz.elearning.common.jgenum;
//
//import redis.clients.jedis.JedisPoolConfig;
//import redis.clients.jedis.JedisShardInfo;
//import redis.clients.jedis.ShardedJedis;
//import redis.clients.jedis.ShardedJedisPool;
//
//import java.util.LinkedList;
//import java.util.List;
//
//public enum ResponseMsgCode {
//    SUCCESS("1011_common_110", "操作成功","Successful operation"),
//    ERROR("1011_common_111", "操作失败","operation failed"),
//    FORMAT_BAD_PHONE("1011_common_112", "手机格式不合法","Invalid phone format"),
//    FORMAT_BAD_MAIL("1011_common_113", "邮箱格式不合法","Invalid email format"),
//    NOT_NULL_PARAM("1011_common_114", "参数params不允许为空","The parameter params cannot be empty"),
//    UPDATE_DATA_NOT_EXIST("1011_common_115","您所更新的数据不存在","The data you updated does not exist"),
//    REPEAT_BAD_PHONE("1011_common_116", "手机号已存在,请修改后重试!","The phone number already exists, please modify it and try again!"),
//    REPEAT_BAD_MAIL("1011_common_117", "邮箱已存在,请修改后重试!","The mailbox already exists, please modify and try again"),
//    AUTH_NOT_ENOUGH("1011_common_118", "你无权进行此操作","You are not authorized to do this"),
//    ILLEGAL_TOKEN("1011_common_119","登录已失效，请重新登录","Login has expired, please log in again"),
//    F_SUCCESS("1011_common_120", "{}成功","{} success"),
//    F_ERROR("1011_common_121", "{}失败","{} failed"),
//    MULTIPLE_ILLEGAL_TOKEN("1011_common_122","您的账号已在其他设备登录","Your account has been logged on to another device"),
//    SERVICE_BUSY("1011_common_123","服务繁忙，请稍后再试！","Service busy, please try again later!"),
//    NOT_REPEAT_SUBMIT("1011_common_124", "请勿重复提交","Please do not submit repeatedly"),
//    REPEAT("1011_common_999", "","");
//
//    // 成员变量
//    public String msgCode;
//    public String msg;
//    public String msgEn;
//
//
//    // 构造方法
//    ResponseMsgCode(String msgCode, String msg,String msgEn) {
//        this.msgCode = msgCode; this.msg = msg; this.msgEn = msgEn;
//    }
//
//    //覆盖方法
//    @Override
//    public String toString() {
//        return this.msgCode+"_"+this.msg+"_"+this.msgEn;
//    }
//
//    public static void main(String[] args) {
//        toRedis();
//    }
//
//
//    public static void toRedis(){
//        System.out.println("连接redis");
//        ShardedJedisPool pool;
//        JedisPoolConfig config = new JedisPoolConfig();
//        config.setMaxTotal(10);
//        config.setMaxIdle(5);
//        config.setMaxWaitMillis(3000);
//        config.setTestOnBorrow(true);
//        config.setTestOnReturn(true);
//        // 集群
//        JedisShardInfo jedisShardInfo1 = new JedisShardInfo("139.159.228.191", 6377);
//        jedisShardInfo1.setPassword("j4kd4ng3s8f3");
//        List<JedisShardInfo> list = new LinkedList<JedisShardInfo>();
//        list.add(jedisShardInfo1);
//        pool = new ShardedJedisPool(config, list);
//        ShardedJedis jedis = pool.getResource();
//        System.out.println("开始初始化数据");
//        ResponseMsgCode[] values = ResponseMsgCode.values();
//        for (ResponseMsgCode code : values){
//            jedis.hset("msg_cn",code.msgCode,code.msg);
//            jedis.hset("msg_en",code.msgCode,code.msgEn);
//        }
//        jedis.close();
//        System.out.println("初始化完毕！");
//        System.exit(0);
//    }
//
//
//}
